﻿namespace AnyOffice.WebControls
{
    using System;
    using System.ComponentModel;
    using System.Web.UI;
    using System.Web.UI.WebControls.WebParts;

    [DefaultProperty("Url"), ToolboxData("<{0}:WebPartIFrame runat=server></{0}:WebPartIFrame>")]
    public class WebPartIFrame : WebPart
    {
        private string _url;

        protected override void RenderContents(HtmlTextWriter output)
        {
            string str = this.ClientID + "_iframe";
            output.Write(string.Format("<iframe id=\"{0}\" name=\"{1}\" src=\"{2}\" width=\"100%\", height=\"100%\" frameborder=\"0\"></iframe>", str, str, this.Url));
        }

        [Localizable(true), DefaultValue(""), Bindable(true), Category("Appearance")]
        public string Url
        {
            get
            {
                return this._url;
            }
            set
            {
                this._url = value;
            }
        }
    }
}

